import { initExecute } from '../../utils/index.js';
// 使用该组件，一定要全局注册ActionButton
export default (hook, { Space, ActionButton }) => {
	return {
		isJiess: true,
		name: 'ActionButtons',
		setup({ buttons = [], size = 'small', ...param }) {
			const execFunc = initExecute.call(this);
			// 在antd中存在Space
			this.add({
				is: Space,
				...param,
				children: execFunc(buttons).map(o => {
					return { is: ActionButton, size, ...o }
				})
			})
		}
	}
}